package cn.tedu.spring.bean;

import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @author 董代恒
 * @version 1.0
 */
@Service
@ToString
public class UserService {
    @Value("业务名称")
    private String name;

    /*
        1、Autowired注解;自动装配
            注入对象[Java类型]、接口
        2、添加位置：
            2.1属性上;
            2.2set方法上;
            2.3构造方法上;
     */
    @Autowired
    private UserDao userDao;

//    @Autowired
//    public void setUserDao(UserDao userDao) {
//        this.userDao = userDao;
//    }

//    @Autowired
//    public UserService(UserDao userDao){
//        this.userDao = userDao;
//    }
}
